﻿<div id="app">
    <div class="page-header page-header-with-buttons">
        <h1 class="pull-left">
            <i class="icon-dashboard"></i>
            <span>Dashboard</span>
        </h1>
        <div class="pull-right">
            <div class="btn-group">
                <a class="btn btn-white hidden-xs" v-link="{path:'/'}">企业列表</a>
                <a class="btn btn-white hidden-xs" v-link="{path:'/view-a'}">创建记录</a>
                @*<a class="btn btn-white" href="#">Last week</a>
                    <a class="btn btn-white " href="#">Today</a>
                    <a class="btn btn-white" id="daterange" href="#">
                        <i class="icon-calendar"></i>
                        <span>Custom</span>
                        <b class="caret"></b>
                    </a>*@

            </div>
        </div>
    </div>
    <router-view></router-view>
</div>
<template id="news">
    <div>
        <h1 v-on:click="test">{{name}}</h1>

        <p>{{msg}}</p>
    </div>
</template>

@section scripts{
    <script>
        (function () {
            var router = new VueRouter();

            var myConponent = Vue.extend({
                template: '#news',
                data: function () {
                    return {
                        name: 'zhourun fa'
                    };
                },
                methods: {
                    test: function () {
                        alert(1);
                    }
                }
            })
            router.map({
                '/view-a': {
                    component: myConponent
                }
            });
            var App = Vue.extend({});
            router.start(App, '#app');
        })();
    </script>
}
